package com.yowasa.xiuxian.engine.travel.adventure;

import com.google.common.collect.Sets;
import com.yowasa.xiuxian.engine.travel.AdventureInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.MapEnum;
import com.yowasa.xiuxian.entity.enums.RefreshType;
import com.yowasa.xiuxian.service.helper.ItemHelper;
import com.yowasa.xiuxian.service.helper.ResourceHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Set;

/**
 * 天龙砂获取
 */
@Component
public class TianLongShaGet implements AdventureInterface {
    @Autowired
    private ItemHelper itemHelper;
    @Autowired
    private ResourceHelper resourceHelper;


    @Override
    public Set<MapEnum> limitMaps() {
        //桃花障only
        return Sets.newHashSet(MapEnum.QING_CE_ZHUANG);
    }

    @Override
    public String exec(UserBO user) {
        if (resourceHelper.checkHaveResource(user.getGuildId(), this.getClass().getName(), RefreshType.JIU_XING)) {
            resourceHelper.useResource(user.getGuildId(), this.getClass().getName());
            itemHelper.addItem(user, "天龙砂", 1);
            return "你发现一个悬崖，在谷底探索发现了天龙砂*1";
        }
        return "你发现一个悬崖，探索谷底发现这个空间及其巨大,四周的墙壁感觉像被巨物挤压过一样";
    }

}
